package screens 
{
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.KeyboardEvent;
	import flash.events.MouseEvent;
	import flash.geom.Rectangle;
	import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.text.TextFormat;
	
	/**
	 * ...
	 * @author Andy Wolff
	 */
	public class TitleScreen extends Screen
	{
		private var main:Main;
		[Embed(source = '../images/Buttons/songmaker.png')] private var titleimg:Class;
		[Embed(source = '../images/Buttons/new.png')] private var newsong:Class;
		[Embed(source = '../images/Buttons/load.png')] private var loadsong:Class;
		[Embed(source='../images/Buttons/helpText.png')] private var help:Class;
		public function TitleScreen(main:Main) 
		{
			this.main = main;
			super();
			graphics.beginFill(0x555555, 1);
			graphics.drawRect(0, 0, 800, 470);
			graphics.endFill();
			
			var title:MovieClip = new MovieClip();
			title.addChild(new titleimg())
			Main.center(title);
			title.y = 20;
			addChild(title);
			
			
			var newsongBtn:MovieClip = new MovieClip();
			newsongBtn.addChild(new newsong());
			Main.center(newsongBtn);
			newsongBtn.y = title.y+title.height + 60;
			addChild(newsongBtn);
			newsongBtn.addEventListener(MouseEvent.CLICK, click_newsong);
			
			var loadsongBtn:MovieClip = new MovieClip();
			loadsongBtn.addChild(new loadsong());
			Main.center(loadsongBtn);
			loadsongBtn.y = newsongBtn.y+newsongBtn.height + 10;
			addChild(loadsongBtn);
			loadsongBtn.addEventListener(MouseEvent.CLICK, click_loadsong);
			
			var helpBtn:MovieClip = new MovieClip();
			helpBtn.addChild(new help());
			Main.center(helpBtn);
			helpBtn.y = loadsongBtn.y+loadsongBtn.height + 10;
			addChild(helpBtn);
			helpBtn.addEventListener(MouseEvent.CLICK, click_help);
			
		}
		
		public function click_newsong(me:MouseEvent):void {
			main.switchScreen(new NewSongScreen(main));
		}
		
		public function click_loadsong(me:MouseEvent):void {
			main.switchScreen(new NewSongScreen(main));
		}
		
		public function click_help(me:MouseEvent):void {
			main.switchScreen(new NewSongScreen(main));
		}
		
		override public function end():void 
		{
			//nothing really
		}
		
	}

}